min.dir = '/home1/99/jc152199/brt/output/min5varsdropped/'
max.dir = '/home1/99/jc152199/brt/output/max3varsdropped/'

min.t.files = list.files(min.dir, pattern='summary', recursive=TRUE, full.names=TRUE)
max.t.files = list.files(max.dir, pattern='summary', recursive=TRUE, full.names=TRUE)

min.model.summary = NULL

for (i in c(1:length(min.t.files)))

	{
	
	t.file = read.csv(min.t.files[i],header=T)
	
	min.model.summary = rbind(min.model.summary, t.file)
	
	}
	
# Close Loop

max.model.summary = NULL

for (i in c(1:length(max.t.files)))

	{
	
	t.file = read.csv(max.t.files[i],header=T)
	
	max.model.summary = rbind(max.model.summary, t.file)
	
	}
	
# Close Loop

# Look for minimum deviance amongst parameters sets where tf = 1
 

max.model.summary[which(max.model.summary$train.deviance==min(max.model.summary$train.deviance)),] # Has no testing deviance

min.model.summary[which(min.model.summary$train.deviance==min(min.model.summary$train.deviance)),]

max.dev.order = order(max.model.summary$train.deviance)

max.se.order = order(max.model.summary$train.deviance.se)

min.dev.order = order(min.model.summary$train.deviance)

min.se.order = order(min.model.summary$train.deviance.se)

for (i in c(1:nrow(max.model.summary)))

	{
	
	










	
	